package edu.ccut.saturn.component.impl.sql;

import java.util.Map;

import edu.ccut.saturn.component.SaturnComponentException;

public class IsNotNullItemInfo extends AbstractSingleExprSqlItemInfo {

	public IsNotNullItemInfo(String prepend, String property) {
		super(prepend, property);
	}

	@Override
	public String getSubSql(Map<String, Object> param) throws Exception {

		if (this.getProperty() != null) {

			if (param.get(this.getProperty()) != null) {
				return parseSql(param);

			} else {
				return " ";
			}
		}
		throw new SaturnComponentException("");
	}

	@Override
	public String getType() {
		return "isNotNull";
	}
}
